EXCEPTION_ACCESS_VIOLATION

Ok, I've been working at this for some time now and having no luck.

In the below code I'm getting an error which I can't seem to find a way around. I was thinking there may be an issue with opening modules with the read() command but. I can't figure it out. I realize this code isn't entirely complete(i.e. missing const variables, code for the contains() function, etc.), but I tried to leave out the parts that I already know are working, and don't touch the anything around the line number I'm getting for the EXCEPTION_ACCESS_VIOLATION. Please take a look and see if you can figure it out.

I'm simply getting the error msg: An unexpected error has occurred: doors.exe caused an EXCEPTION_ACCESS_VIOLATION in module doors.exe at 0023:00951C6D

 as well as the line number to the for loop in the verifyBaseline() function.


developerTom - Wed Oct 16 17:11:02 EDT 2013

Re: EXCEPTION_ACCESS_VIOLATION
llandale - Thu Oct 17 13:44:42 EDT 2013

It would help if you presented the precise DXL error you got in the DXL Window; in particular the line number and then tell us which line that is.

I'm guessing your error is here, since variable "op" is null for the 1st object in the module.

  • put(a, (op."Object Heading" "") ...

I wonder if your choice of variable "item" is causing problems; since that is the name of a perm.  Try "itm" instead.

On other news...

  • Don't declare "Module m = current" as it make is seem the function deals with the "current" module when it does not.  Contrast that with "Project p = current" which is appropriate.
  • I would auto-load the "Standard view", as your code is dependant on the filtering of the moduole default view, and "for o in mod do" loop may not find all objects you care about.
    • readm = read(fullName(item), false, true)
  • If "readm" is type "module", you don't need this.  Actually, you don't want this:
    • m = module(item)
  • do this:
    • m = read(fullName(item), false, true)
  • Make SURE you set the current Module before commands that presume it:
    • current = m
    • if (exists attribute ...)
  • tend to use function "probeAttr_" instead of o.NameAttr references
    • probeAttr_(o, ("!" (currentProduct) "-RqmtType" ""))
  • I think this is better, but not sure why:
    • if (type(item) == "Formal")

-Louie

Re: EXCEPTION_ACCESS_VIOLATION
developerTom - Mon Oct 21 07:58:04 EDT 2013

llandale - Thu Oct 17 13:44:42 EDT 2013

It would help if you presented the precise DXL error you got in the DXL Window; in particular the line number and then tell us which line that is.

I'm guessing your error is here, since variable "op" is null for the 1st object in the module.

  • put(a, (op."Object Heading" "") ...

I wonder if your choice of variable "item" is causing problems; since that is the name of a perm.  Try "itm" instead.

On other news...

  • Don't declare "Module m = current" as it make is seem the function deals with the "current" module when it does not.  Contrast that with "Project p = current" which is appropriate.
  • I would auto-load the "Standard view", as your code is dependant on the filtering of the moduole default view, and "for o in mod do" loop may not find all objects you care about.
    • readm = read(fullName(item), false, true)
  • If "readm" is type "module", you don't need this.  Actually, you don't want this:
    • m = module(item)
  • do this:
    • m = read(fullName(item), false, true)
  • Make SURE you set the current Module before commands that presume it:
    • current = m
    • if (exists attribute ...)
  • tend to use function "probeAttr_" instead of o.NameAttr references
    • probeAttr_(o, ("!" (currentProduct) "-RqmtType" ""))
  • I think this is better, but not sure why:
    • if (type(item) == "Formal")

-Louie

Hey, thanks for your help. I've implemented your suggestions and have gotten everything working. Re-writting the read() command and using the probeAttr_ were a big help.